<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>按钮的样式</title>
    <style>
        .green-button {
            background-color: #4CAF50; /* Green */
            border: none;
            color: white;
            /*
            说明:
                1. padding和font-size这两个属性相当于是动态的确定了按钮的长度和宽度.
                    - 这样做的好处是可以通过font-size属性来控制按钮的大小.
            */
            padding: 10px 15px;
            font-size: 16px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            border-radius: 5px;
            /*
            功能:
                控制鼠标移入使鼠标变为手型.
            */
            cursor: pointer;
        }

        .button1 {background-color: #4CAF50;} /* Green */
        .button2 {
            background-color: #008CBA;
            -webkit-transition-duration: 0.4s; /* Safari */
            transition-duration: 0.4s;
        } /* Blue */
        .button3 {background-color: #f44336;} /* Red */
        .button4 {background-color: #e7e7e7; color: black;} /* Gray */
        .button5 {background-color: #555555;} /* Black */

        .button2:hover {
            box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
        }

        .disabled {
            /*设置透明度*/
            opacity: 0.2;
            /*禁用所有事件*/
            pointer-events:none;
        }

    </style>
</head>
<body>
<button class="green-button">绿色按钮</button>
<button class="green-button button2">蓝色按钮</button>
<button class="green-button button3">红色按钮</button>
<button class="green-button button4">灰色按钮黑色字体</button>
<button onclick="logMessage()" class="green-button button3 disabled">禁用按钮</button>

</body>
<script>

    function logMessage() {
        console.log("sss");
    }

</script>
</html>